package com.moliku.insurance.model.dto.insure;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 保单基本信息
 *
 * @author Mr.Liu
 * @since 2021/3/5
 */
@Data
public class OrderDTO implements Serializable {

    private static final long serialVersionUID = -5268989663331937009L;
    @ApiModelProperty(value = "交易流水号（合作伙伴生成的订单唯一id，用来防止重复添加订单）")
    @NotBlank(message = "交易流水号不能为空")
    private String serialNumber;

    @ApiModelProperty(value = "产品编码")
    @NotBlank(message = "产品编码不能为空")
    private String productCode;

    @ApiModelProperty(value = "保费")
    private BigDecimal premium;

    @ApiModelProperty(value = "产品名称", hidden = true)
    private String productName;

    @ApiModelProperty(value = "一级渠道编码")
    @NotBlank(message = "一级渠道编码不能为空")
    private String channel1Code;

    @ApiModelProperty(value = "一级渠道名称", hidden = true)
    private String channel1Name;

    @ApiModelProperty(value = "二级渠道编码")
    private String channel2Code;

    @ApiModelProperty(value = "二级渠道名称", hidden = true)
    private String channel2Name;

    @ApiModelProperty(value = "三级渠道编码")
    private String channel3Code;

    @ApiModelProperty(value = "三级渠道名称", hidden = true)
    private String channel3Name;

    @ApiModelProperty(value = "保险开始时间,yyyy-MM-dd HH:mm:ss")
    @NotBlank(message = "保险开始时间不能为空")
    @Pattern(message = "保险开始时间格式不正确", regexp = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s+([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$")
    private String startTime;

    @ApiModelProperty(value = "保险结束时间,yyyy-MM-dd HH:mm:ss")
    @NotBlank(message = "保险结束时间不能为空")
    @Pattern(message = "保险结束时间格式不正确", regexp = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s+([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$")
    private String endTime;

    @ApiModelProperty(value = "出行目的地（境外产品必须；境内产品不需要，用分号隔开。法国;德国;丹麦）")
    private String destination;

    public String getStartTime() {
        return startTime;
    }

    public String getEndTime() {
        return endTime;
    }
}
